#include "_sort.h"
const int N = 2000000;
int a[N];

void q_sort_test()
{
    srand(time(0));
    const int N = 100;
    int a[N];
    for (int i = 0; i < N; i++)
    {
        a[i] = rand() % (N + 1);
    }

    for (int i = 0; i < N; i++)
        cout << a[i] << ' ';
    cout << '\n';

    q_sort(a, a + N);
    for (int i = 0; i < N; i++)
        cout << a[i] << ' ';
    cout << '\n';
}

void init()
{
    for (int i = 0; i < N; i++)
        // a[i] = N - i;
        a[i] = rand();
}

void ins_sort_test()
{
    DWORD t1, t2;

    init();
    t1 = GetTickCount();
    ShellSort(a, a + N);
    t2 = GetTickCount();
    cout << "Sehll: " << t2 - t1 << '\n';

    init();
    t1 = GetTickCount64();
    q_sort(a, a + N);
    t2 = GetTickCount64();
    cout << "Qsort: " << t2 - t1 << '\n';
}

void mergsort_test()
{
    DWORD t1, t2;
    init();
    t1 = GetTickCount();
    MergSort(a, a + N);
    t2 = GetTickCount();
    cout << "merg_sort: " << t2 - t1 << '\n';
}

void countSort_test()
{
    DWORD t1, t2;
    init();
    t1 = GetTickCount();
    CountSort(a, a + N);
    t2 = GetTickCount();
    cout << "count_sort: " << t2 - t1 << '\n';
}

int main()
{

    mergsort_test();
    ins_sort_test();
    countSort_test();

    return 0;
}